home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWFiles / Include / SLFilRep.xh < prev    next >
Encoding:
Text File  |  1996-04-23  |  8.8 KB  |  375 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLFilRep.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *     File:                SLFilRep.idl
  13.  * 
  14.  *     Contains:            Interface for FW_OFile class
  15.  *     Release Version:    $ ODF 1 $
  16.  * 
  17.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  18.  * 
  19.  */
  20.  
  21.  
  22. #ifndef SOM_FW_OFile_xh
  23. #define SOM_FW_OFile_xh
  24.  
  25. class FW_OFile;
  26.  
  27. #define FW_OFile_MajorVersion 1
  28. #define FW_OFile_MinorVersion 0
  29.  
  30. /*
  31.  * Passthru lines: File: "C.xh", "before"
  32.  */
  33.  
  34.  
  35. /* C++ SOM defs */
  36. #include <somcls.xh>
  37. #include <somcm.xh>
  38.  
  39. /* C++ parent defs */
  40. #ifndef SOM_FW_ORefCount_xh
  41. #include <SLRefCnt.xh>
  42. #endif
  43.  
  44. #ifndef FW_OFile_API
  45. #define FW_OFile_API
  46. /*
  47.  * -- The Class API
  48.  */
  49.  
  50. /*
  51.  * Start of user-defined types:
  52.  */
  53. class SOMClass;
  54. class SOMObject;
  55. class FW_ORefCount;
  56. class FW_OFileSpecification;
  57. class FW_ODirectorySpecification;
  58. class FW_OFile;
  59.  
  60. /*
  61.  * End of user-defined types.
  62.  */
  63.  
  64. #ifdef OLDIBMSOMAPISUPPORT
  65. #define FW_OFileCClassData FW_OFileClassData
  66. #define FW_OFileNewClass(major,minor) somNewVersionedClassReference(FW_OFile,major,minor)
  67. #endif
  68.  
  69. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  70. #define FW_OFileMetaClass SOMClass
  71.  
  72. #if PRAGMA_ALIGN_SUPPORTED
  73. #  pragma options align=power
  74. #endif
  75.  
  76. /* The API to the FW_OFile class object, and the methods it introduces. */
  77. SOMEXTERN struct FW_OFileClassDataStructure {
  78. #ifdef OLDIBMSOMAPISUPPORT
  79.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  80. #else
  81.     long zero;
  82. #endif
  83.     somStaticClassInfo *sci;
  84.     somDToken        instanceDataToken;
  85.     long reserved [3];
  86.     somMToken somInit;
  87.     somMToken somUninit;
  88.     somMToken InitWithExclusiveAccess;
  89.     somMToken InitWithPermissions;
  90.     somMToken Read;
  91.     somMToken Write;
  92.     somMToken GetLength;
  93.     somMToken SetLength;
  94.     somMToken GetPosition;
  95.     somMToken SetPosition;
  96.     somMToken BytesToEndOfFile;
  97.     somMToken GetPermissions;
  98.     somMToken GetFileSpecification;
  99.     somMToken GetFileHandle;
  100.     somMToken IsEqual;
  101. } SOMDLINK FW_OFileClassData;
  102.  
  103. #if PRAGMA_ALIGN_SUPPORTED
  104. #  pragma options align=reset
  105. #endif
  106.  
  107. #if !defined(FW_OFile_Class_Source) && !defined(SOM_Module_slfilrep_Source)
  108. #if PRAGMA_IMPORT_SUPPORTED
  109. #pragma import list FW_OFileClassData
  110. #endif
  111. #endif
  112.  
  113.  
  114. /*
  115.  * -- Typedefs and inline method declarations for left path inherited methods
  116.  * -- are omitted because this compilation had -museinheritedmethods in effect
  117.  */
  118.  
  119.  
  120. /*
  121.  * -- Typedefs for FW_OFile Method Procedures
  122.  */
  123. SOMEXTERN {
  124. typedef void   (* SOMLINK somTD_FW_OFile_InitWithExclusiveAccess)(FW_OFile *somSelf, Environment *ev,
  125.         FW_OFileSpecification* fileSpecification,
  126.         FW_Boolean allowCreate);
  127. typedef void   (* SOMLINK somTD_FW_OFile_InitWithPermissions)(FW_OFile *somSelf, Environment *ev,
  128.         FW_OFileSpecification* fileSpecification,
  129.         FW_SAccessPermission* permission,
  130.         FW_Boolean allowCreate);
  131. typedef void   (* SOMLINK somTD_FW_OFile_Read)(FW_OFile *somSelf, Environment *ev,
  132.         void* destination,
  133.         long count);
  134. typedef void   (* SOMLINK somTD_FW_OFile_Write)(FW_OFile *somSelf, Environment *ev,
  135.         void* source,
  136.         long count);
  137. typedef long   (* SOMLINK somTD_FW_OFile_GetLength)(FW_OFile *somSelf, Environment *ev);
  138. typedef void   (* SOMLINK somTD_FW_OFile_SetLength)(FW_OFile *somSelf, Environment *ev,
  139.         long length);
  140. typedef long   (* SOMLINK somTD_FW_OFile_GetPosition)(FW_OFile *somSelf, Environment *ev);
  141. typedef void   (* SOMLINK somTD_FW_OFile_SetPosition)(FW_OFile *somSelf, Environment *ev,
  142.         long positioningMode,
  143.         long markOffset);
  144. typedef long   (* SOMLINK somTD_FW_OFile_BytesToEndOfFile)(FW_OFile *somSelf, Environment *ev);
  145. typedef void   (* SOMLINK somTD_FW_OFile_GetPermissions)(FW_OFile *somSelf, Environment *ev,
  146.         FW_SAccessPermission* thePerms);
  147. typedef FW_OFileSpecification*   (* SOMLINK somTD_FW_OFile_GetFileSpecification)(FW_OFile *somSelf, Environment *ev);
  148. typedef FW_FileAccessHandle*   (* SOMLINK somTD_FW_OFile_GetFileHandle)(FW_OFile *somSelf, Environment *ev);
  149. typedef FW_Boolean   (* SOMLINK somTD_FW_OFile_IsEqual)(FW_OFile *somSelf, Environment *ev,
  150.         FW_OFile* theOtherFile);
  151. }
  152.  
  153. #endif /* FW_OFile_API */
  154.  
  155.  
  156. /*
  157.  * -- This emitter treats Method Tokens as Thunks by default.
  158.  * -- Use the sc modifier "nothunks" to change this default
  159.  */
  160. #undef somresolve_
  161. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  162.  
  163. /*
  164.  * -- The C++ Wrapper Class for FW_OFile
  165.  */
  166. class FW_OFile : public FW_ORefCount
  167. {
  168. public:
  169.  
  170. // FW_OFile::new registers use of the class object, and then uses somNew
  171. // to allocate memory and load the object method table pointer. 
  172. void *operator new(size_t size)
  173. {
  174.     SOM_IgnoreWarning(size);
  175.     // Allocate memory using the default allocator for FW_OFile, and
  176.     // clear mem & set method table pointer, call basic initialization
  177. #ifdef SOMCHKNULL
  178.     void * __somResult = (void *)
  179.       somNewObject(FW_OFile);
  180.     SOMCHKNULL(__somResult);
  181.     return __somResult;
  182. #else
  183.     return (void*) somNewObject(FW_OFile);
  184. #endif
  185. }
  186.  
  187. // FW_OFile::delete uses the default deallocator for the object's class.
  188. void operator delete(void * obj)
  189. {
  190.     if (obj) {
  191.         SOM_Resolve(obj,SOMObject,somFree)
  192.            ( (SOMObject*) obj );
  193.     }
  194. }
  195.  
  196. /* method: InitWithExclusiveAccess */
  197. void   InitWithExclusiveAccess(Environment *ev,
  198.         FW_OFileSpecification* fileSpecification,
  199.         FW_Boolean allowCreate)
  200. {
  201.    SOM_ResolveD(this,FW_OFile,FW_OFile,InitWithExclusiveAccess)
  202.     (this,ev,fileSpecification,allowCreate);
  203. #ifdef SOMCHKEXCEPT
  204.       SOMCHKEXCEPT;
  205. #endif
  206. }
  207.  
  208. /* method: InitWithPermissions */
  209. void   InitWithPermissions(Environment *ev,
  210.         FW_OFileSpecification* fileSpecification,
  211.         FW_SAccessPermission* permission,
  212.         FW_Boolean allowCreate)
  213. {
  214.    SOM_ResolveD(this,FW_OFile,FW_OFile,InitWithPermissions)
  215.     (this,ev,fileSpecification,permission,allowCreate);
  216. #ifdef SOMCHKEXCEPT
  217.       SOMCHKEXCEPT;
  218. #endif
  219. }
  220.  
  221. /* method: Read */
  222. void   Read(Environment *ev,
  223.         void* destination,
  224.         long count)
  225. {
  226.    SOM_ResolveD(this,FW_OFile,FW_OFile,Read)
  227.     (this,ev,destination,count);
  228. #ifdef SOMCHKEXCEPT
  229.       SOMCHKEXCEPT;
  230. #endif
  231. }
  232.  
  233. /* method: Write */
  234. void   Write(Environment *ev,
  235.         void* source,
  236.         long count)
  237. {
  238.    SOM_ResolveD(this,FW_OFile,FW_OFile,Write)
  239.     (this,ev,source,count);
  240. #ifdef SOMCHKEXCEPT
  241.       SOMCHKEXCEPT;
  242. #endif
  243. }
  244.  
  245. /* method: GetLength */
  246. long   GetLength(Environment *ev)
  247. {
  248.    #ifdef SOMCHKEXCEPT
  249.    long __somResult = 
  250.       SOM_ResolveD(this,FW_OFile,FW_OFile,GetLength)
  251.     (this,ev);
  252.       SOMCHKEXCEPT;
  253.    return __somResult;
  254. #else
  255.    return SOM_ResolveD(this,FW_OFile,FW_OFile,GetLength)
  256.     (this,ev);
  257. #endif
  258. }
  259.  
  260. /* method: SetLength */
  261. void   SetLength(Environment *ev,
  262.         long length)
  263. {
  264.    SOM_ResolveD(this,FW_OFile,FW_OFile,SetLength)
  265.     (this,ev,length);
  266. #ifdef SOMCHKEXCEPT
  267.       SOMCHKEXCEPT;
  268. #endif
  269. }
  270.  
  271. /* method: GetPosition */
  272. long   GetPosition(Environment *ev)
  273. {
  274.    #ifdef SOMCHKEXCEPT
  275.    long __somResult = 
  276.       SOM_ResolveD(this,FW_OFile,FW_OFile,GetPosition)
  277.     (this,ev);
  278.       SOMCHKEXCEPT;
  279.    return __somResult;
  280. #else
  281.    return SOM_ResolveD(this,FW_OFile,FW_OFile,GetPosition)
  282.     (this,ev);
  283. #endif
  284. }
  285.  
  286. /* method: SetPosition */
  287. void   SetPosition(Environment *ev,
  288.         long positioningMode,
  289.         long markOffset)
  290. {
  291.    SOM_ResolveD(this,FW_OFile,FW_OFile,SetPosition)
  292.     (this,ev,positioningMode,markOffset);
  293. #ifdef SOMCHKEXCEPT
  294.       SOMCHKEXCEPT;
  295. #endif
  296. }
  297.  
  298. /* method: BytesToEndOfFile */
  299. long   BytesToEndOfFile(Environment *ev)
  300. {
  301.    #ifdef SOMCHKEXCEPT
  302.    long __somResult = 
  303.       SOM_ResolveD(this,FW_OFile,FW_OFile,BytesToEndOfFile)
  304.     (this,ev);
  305.       SOMCHKEXCEPT;
  306.    return __somResult;
  307. #else
  308.    return SOM_ResolveD(this,FW_OFile,FW_OFile,BytesToEndOfFile)
  309.     (this,ev);
  310. #endif
  311. }
  312.  
  313. /* method: GetPermissions */
  314. void   GetPermissions(Environment *ev,
  315.         FW_SAccessPermission* thePerms)
  316. {
  317.    SOM_ResolveD(this,FW_OFile,FW_OFile,GetPermissions)
  318.     (this,ev,thePerms);
  319. #ifdef SOMCHKEXCEPT
  320.       SOMCHKEXCEPT;
  321. #endif
  322. }
  323.  
  324. /* method: GetFileSpecification */
  325. FW_OFileSpecification*   GetFileSpecification(Environment *ev)
  326. {
  327.    #ifdef SOMCHKEXCEPT
  328.    FW_OFileSpecification* __somResult = 
  329.       SOM_ResolveD(this,FW_OFile,FW_OFile,GetFileSpecification)
  330.     (this,ev);
  331.       SOMCHKEXCEPT;
  332.    return __somResult;
  333. #else
  334.    return SOM_ResolveD(this,FW_OFile,FW_OFile,GetFileSpecification)
  335.     (this,ev);
  336. #endif
  337. }
  338.  
  339. /* method: GetFileHandle */
  340. FW_FileAccessHandle*   GetFileHandle(Environment *ev)
  341. {
  342.    #ifdef SOMCHKEXCEPT
  343.    FW_FileAccessHandle* __somResult = 
  344.       SOM_ResolveD(this,FW_OFile,FW_OFile,GetFileHandle)
  345.     (this,ev);
  346.       SOMCHKEXCEPT;
  347.    return __somResult;
  348. #else
  349.    return SOM_ResolveD(this,FW_OFile,FW_OFile,GetFileHandle)
  350.     (this,ev);
  351. #endif
  352. }
  353.  
  354. /* method: IsEqual */
  355. FW_Boolean   IsEqual(Environment *ev,
  356.         FW_OFile* theOtherFile)
  357. {
  358.    #ifdef SOMCHKEXCEPT
  359.    FW_Boolean __somResult = 
  360.       SOM_ResolveD(this,FW_OFile,FW_OFile,IsEqual)
  361.     (this,ev,theOtherFile);
  362.       SOMCHKEXCEPT;
  363.    return __somResult;
  364. #else
  365.    return SOM_ResolveD(this,FW_OFile,FW_OFile,IsEqual)
  366.     (this,ev,theOtherFile);
  367. #endif
  368. }
  369.  
  370. };   /* FW_OFile */
  371.  
  372.  
  373.  
  374. #endif       /* SOM_FW_OFile_xh */
  375.